package pre;

/**
 * @program: leetcode
 * @author: jzhou
 * @date: 2022-11-20 20:13
 * @version: 1.0
 * @description: 数字反转
 **/
public class NumberReverse {

    public static int numberReverse(int num){
        int reverse = 0;
        while (num != 0){
            reverse = num % 10 + reverse * 10;
            num = num / 10;
        }
        return reverse;
    }

    public static void main(String[] args) {
        System.out.println(numberReverse(1004));
    }

}
